<?php


class IW_Controller extends TinyMVC_Controller
{
	
	function redirect($url) 
	{
		header("Location: $url");
	}
	
	function url($controller, $action = "index", $params = array())
	{
		$url = IW_BASEURI. "$controller/$action";
		if(!empty($params)) {
			$url .= '/' . implode('/', $params);
		} 
	}
	
	
	function params() 
	{
		return $this->uri->uri_to_array();
	}

	function paramsAssoc() 
	{
		return $this->uri->uri_to_assoc();
	}
	
	function paramIndex($index)
	{
		return $this->uri->segment($index);
	}
	
}